package com.example.administrator.testc.TestAF;/**
 * Created by Administrator on 2016/4/14 0014.
 */

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.example.administrator.testc.mApp;

import pri.zey.custom.AFMananger.ActivityBase;
import pri.zey.custom.tools.TL;

/**
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>类描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>属性描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>方法描述
 */
public class Activity_3 extends ActivityBase {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Button bt = new Button(this);
        bt.setText(this.toString());
        setContentView(bt);
        bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                startActivity(new Intent(getApplicationContext(), ApplicationBase.af.control.getTop().getClass()));
//                ApplicationBase.af.control.delAll();
//                List<TlBean> list = new ArrayList<TlBean>();
//                TlBean bean = new TlBean();
//                bean.tag = TL.eL; bean.msg = "this " + Activity_3.class.toString();
//                list.add(bean);
//                bean = new TlBean();
//                bean.tag = TL.eL; bean.msg = "del " + Activity_1.class.toString();
//                list.add(bean);
//                bean = new TlBean();
//                bean.tag = TL.eL; bean.msg = "del " + Activity_2.class.toString();
//                list.add(bean);
//                TL.Map(list);
//                mApp.control.del(Activity_1.class.getName());
//                mApp.control.del(1);
//                mApp.control.del(Activity_2.class.getName());
//                Activity_2 activity_2 = new Activity_2();
//                if(activity_2.getApplicationContext() != null)
//                mApp.control.update(activity_2, new TestMain());
//                Log.i("TAGSS", "getIndex : " + this.getClass() + " " + mApp.control.getT(activity_2));
                finish();
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Message msg = new Message();
        msg.arg1 = 1234567890;
//        mApp.control.sendMsg(Activity_2.class.getName(), msg, new InterfaceHandler() {
//            @Override
//            public void onHandler(Message msg) {
//                Log.i("TAGSS", "Class Name : " +  this.getClass().getName());
//                Log.i("TAGSS", "arg1 : " +  msg.arg1);
//                Log.i("TAGSS", "arg2 : " +  msg.arg2);
//                Log.i("TAGSS", "getData : " +  msg.getData().getString("key"));
//            }
//        });
        handler.sendMessage(msg);
        mApp.control.sendMsg(handler, null);
        TL.e("TAGSS", "destroy " + this.toString());
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }

    Handler handler = new Handler(new Handler.Callback() {
        @Override
        public boolean handleMessage(Message msg) {
            Log.i("TAGSS", "Class Name : " +  this.getClass().getName());
            Log.i("TAGSS", "arg1 : " +  msg.arg1);
            Log.i("TAGSS", "arg2 : " +  msg.arg2);
            Log.i("TAGSS", "getData : " +  msg.getData().getString("key"));
            return false;
        }
    });
}
